package com.adcc.swingui.base;

import java.awt.Container;

import javax.swing.JLabel;
import javax.swing.JPanel;

import com.jidesoft.dialog.AbstractDialogPage;

/**
 * <p>
 * Title: AbsContentPanel
 * </p>
 * <p>
 * Description: 显示内容面板基类
 * </p>
 * <p>
 * Copyright: Copyright (c) 2010
 * </p>
 * 
 * @author jeff.zhao
 * @version 1.0.0
 */
public abstract class DefaultOptionsPanel extends AbstractDialogPage {
	private static final long serialVersionUID = 1L;
	private JPanel contentPanel;
	private JLabel titLab;
	/**
	 * 是否加载完毕
	 */
	protected boolean inited = false;
	/**
	 * swing框架容器
	 */
	protected Container container;
	
	// private JButton butapply ;
	public DefaultOptionsPanel() {
		
	}
	public DefaultOptionsPanel(String name, Container container) {
		super(name);
		this.container = container;
	}

	public void setShowtitle(String showtitle) {
		this.titLab.setText(showtitle);
	}


	public boolean isInited() {
		return inited;
	}
	public JPanel getContentPanel() {
		return contentPanel;
	}

	public void setContentPanel(JPanel contentPanel) {
		this.contentPanel = contentPanel;
	}
	/**
	 * 点击应用，把值设置到model中，并序列化到文件
	 * @return
	 */
	public abstract boolean apply();
	/**
	 * 恢复系统初始设置
	 */
	public abstract void restoreDefault();
	/**
	 * 恢复model中上次保存的设置，点击取消或关闭窗口时使用
	 */
	public abstract void restoreModel();
	/**
	 * 注册model，并且对model注册监听器，一般来说注册唯一监听器就行。
	 */
	public abstract void registerModel();
	/**
	 * 国际化
	 */
	public abstract void i18n();
}
